package net.apps.test;

import net.apps.core.ApplFactory;
import net.apps.core.ApplManagerRaw;
import net.apps.core.ApplManagerStd;
import net.apps.core.meta.ProtocolMetaImpl;
import net.apps.std.Keyboard;
import net.apps.std.TextEditor;
import net.apps.std.TextMessageProtocol;

public final class Main {

	public static void main(String[] args) {
		ApplFactory.registerProtocol(new ProtocolMetaImpl(TextMessageProtocol.class));
		ApplManagerRaw amgr1 = ApplFactory.makeRawApplManager();
		ApplManagerStd amgr2 = ApplFactory.makeStdApplManager();
//		TestPipe pipe = new TestPipe(amgr1, amgr2);
//		Connection std_conn1 = pipe.conn1;
//		Connection std_conn2 = pipe.conn2;
		amgr1.instantiateAppl(Keyboard.class);
		amgr2.instantiateAppl(TextEditor.class);
		new Thread(amgr2).start();
		amgr1.run();
	}

}
